import { PageParams, PageResult } from "@/types/common"
import { EmployeeData, EmployeeResult } from "@/types/employee"
import request from "@/utils/request"

/**
 * 分页查询  query参数
 * @param data 
 * @returns 
 */
export const getBusinessPageAPI = (params: PageParams & { name?: string }) => {
  return request<PageResult<EmployeeResult[]>>({
    method: 'GET',
    url: '/admin/business/page',
    params
  })
}
/**
 * 启用、禁用员工账号  query参数
 * @param status 
 * @param id 
 * @returns 
 */
export const postBusinessStatusAPI = (status: number, id: number) => {
  return request({
    method: 'POST',
    url: `/admin/business/status/${status}`,
    params: { id }
  })
}
/**
 * 新增员工 body参数
 * @param params 
 * @returns 
 */
export const addBusinessAPI = (employeeData: EmployeeData) => {
  return request({
    method: 'POST',
    url: '/admin/business',
    data: employeeData
  })
}
/**
 * 根据id查询商家
 * @param id 
 * @returns 
 */
export const getAdminBusinessAPI = (id: number) => {
  return request<EmployeeResult>({
    method: 'GET',
    url: `/admin/business/${id}`
  })
}
// /**
//  * 编辑员工信息 Body参数
//  * @param params
//  * @returns
//  */
// export const putBusinessAPI = (employeeData: EmployeeData) => {
//   return request({
//     method: 'PUT',
//     url: '/admin/business',
//     data: employeeData
//   })
// }